<template>
	<view>
		<u-cell-group v-model="form">
			<u-cell-item title="工号" :arrow="false">{{form.jobNumber}}</u-cell-item>
			<u-cell-item title="隶属部门" :arrow="false">{{form.departmentName}}</u-cell-item>
			<u-cell-item title="入职时间" :arrow="false">{{form.entryTime}}</u-cell-item>
			<u-cell-item title="手机号" @tap="toEditPhone" :label="descriptionInfo">
				{{form.phone ? form.phone : '去绑定'}}
			</u-cell-item>
		</u-cell-group>
	</view>
</template>

<script>
import { accessPersonInfo } from '../utils/index.js'
	export default{
		data() {
			return {
				form: {
					phone: '',			//员工手机号
					entryTime: '',		//入职时间
					jobNumber:'',		//员工工号
					departmentName:''	//隶属部门
				},
				descriptionInfo: '点击进入修改微信绑定手机号'			//修改绑定手机号的提示信息
			}
		},
		// 进入页面即获取员工信息
		onLoad() {
			this.getUserInfo();
		},
		methods:{
			// 跳转到修改手机号页面
			toEditPhone(){
				uni.navigateTo({
					url:'./changePhone'
				})
			},	
			// 获取用户相关信息
			async getUserInfo(){
				const {data} = await accessPersonInfo()
				this.form = Object.assign({},data.data)
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>
